import {createApp} from 'vue';

import 'ant-design-vue/dist/antd.less';
import "@/common/style/style.less";
import 'nprogress/css/nprogress.css'
import Antd, {message} from "ant-design-vue";
import router from "@/common/router/router";
import store from "@/common/store/store";
import App from './App.vue';
import * as Icons from '@ant-design/icons-vue';
import $http from "@/common/util/http";
import '@/permission'

import {$event} from "@/common/util/event";
import {clipboard, hasPermission} from "@/common/util/direct";
// import "@/common/mock/mock";

const app = createApp(App);


Object.keys(Icons).forEach(key => {
    app.component(key, Icons[key])
})
app.config.globalProperties.$icons = Icons;
app.config.globalProperties.$message = message;
// @ts-ignore
app.config.globalProperties.$event = $event;
app.config.globalProperties.$http = $http;

//错误信息
app.config.errorHandler = (err, vm, info) => {
    console.error('错误信息', err)
    //console.log('vm', vm)
    //console.log('info', info)
}
//警告信息
app.config.warnHandler = function (msg, vm, trace) {
    // `trace` 是组件的继承关系追踪
    //console.log('msg', msg)
    //console.log('vm', vm)
    //console.log('trace', trace)
}


app.use(Antd);
// app.use(Antd);
app.use(router);
app.use(store);
//指令
app.use(hasPermission)
app.use(clipboard)
app.mount('#app');

